package grape.attend.service.user.api;

import grape.attend.service.user.po.UserClock;
import grape.attend.service.user.po.UserOvertime;
import grape.common.service.common.IBaseService;

import java.util.List;

/**
 * <p>
 * 用户加班表 服务类
 * </p>
 *
 * @author yangwei
 * @since 2020-05-18
 */
public interface IUserOvertimeService extends IBaseService<UserOvertime> {

    /**
     * 根据打卡记录id查询
     * @param userId
     * @param userClockId
     * @return
     */
    default UserOvertime getByUserIdAndUserClockId(String userId,String userClockId) {
        assertParamNotEmpty(userId,"userId不能为空");
        assertParamNotEmpty(userClockId,"userClockId不能为空");
        UserOvertime userOvertime = new UserOvertime();
        userOvertime.setUserId(userId);
        userOvertime.setUserClockId(userClockId);
        return getOne(userOvertime);
    }

    /**
     * 查询用户某月的加班记录
     * @param monthMs
     * @param userId
     * @return
     */
    List<UserOvertime> getByUserIdAndMonth(Long monthMs, String userId);
}
